package com.kitbox.hl.meshow.openid.oauth2.service;

import com.kitbox.hl.meshow.openid.oauth2.service.Impl.MongodbTokenStore;
import com.kitbox.hl.meshow.openid.oauth2.service.Impl.MyRedisTokenStore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;

/**
 * @author: honglei
 * @Date: 2019/7/11 15:34
 * @Version: 1.0
 * @See:
 * @Description:
 */
@Configuration
public class TonkenStoreConfig {

    @Autowired
    private JedisConnectionFactory jedisConnectionFactory;

    @Bean(name = "redisTokenStore")
    public MyTokenStore getRedisTokenStore() {
        return new MyRedisTokenStore(jedisConnectionFactory);
    }
    @Bean(name = "mongodbTokenStore")
    public MyTokenStore getMongodbTokenStore(){
        return new MongodbTokenStore();
    }
}
